import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { DbLogger } from '../log4js/utils';

export const db: TypeOrmModuleOptions = {
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'root',
  password: 'root',
  database: 'love',
  synchronize: true,
  cache: true,
  autoLoadEntities: true,
  logging: true,
  maxQueryExecutionTime: 1000,
  logger: new DbLogger(), // 配置项添加自定义的log类
  timezone: '+08:00',
};
